package com.yzc.mihuyou.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yzc.mihuyou.entity.Comment;
import com.yzc.mihuyou.entity.Pingive;
import com.yzc.mihuyou.mapper.PingiveMapper;
import com.yzc.mihuyou.service.PingiveService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yzc.mihuyou.vo.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yzc
 * @since 2022-05-04
 */
@Service
public class PingiveServiceImpl extends ServiceImpl<PingiveMapper, Pingive> implements PingiveService {

    @Autowired
    PingiveMapper pingiveMapper;


    @Override
    public List<Comment> likeInform(long id) {
        List<Comment> list = pingiveMapper.likeInform((int) id);
        System.out.print(list);
        return list;
    }

    @Override
    public Boolean inbut(int comId, Long uid) {
        QueryWrapper<Pingive> queryWrapperWuw=new QueryWrapper<>();
        queryWrapperWuw.eq("pinzan",comId);
        queryWrapperWuw.eq("user_id",uid);
        List<Pingive> pr=pingiveMapper.selectList(queryWrapperWuw);
        return pr.size()==0?false:true;
    }
}
